
<?php
    echo $this->Html->link('Test','',array('class'=>'button', 'id'=>'link'));
    $this->Js->get('#link');
    $this->Js->event('click', $this->Js->alert('hey you!'));

    echo $this->Html->link('AjaxPush','',array('class'=>'button', 'id'=>'incr'));
    
    $this->Js->get('#incr');
    $this->Js->event('click',
            $this->Js->request(array(
            'action' => 'increment',$amount), array(
            'async' => true,
            'update' => '#counter')));

?>
<div id="counter">
    <?php
    echo $amount;
   
    ?>
</div>